package base;

import java.io.Serializable;

public class User implements Cloneable,Serializable{
	private static final long serialVersionUID = 740922363347624404L;
	private int ID;
	private String username;//�˺�
	private String password;
    private String realname;//�ǳ�
    private int sex;//0����У�1���Ů
    private String email;
    private boolean isAdmin;
    private String phoneNumber;
    private boolean ispubliccontact;
    
    
    public User(int ID,String username,String password,String realname,int sex,String email,String phone,boolean b){  //for client
    	this.ID=ID;
    	this.username=username;
    	this.sex=sex;
    	this.realname=realname;
    	this.password=password;
    	this.isAdmin=false;
    	this.email=email;
    	this.phoneNumber=phone;
    	this.ispubliccontact=b;
    }
    public User(String username,String password,String realname,int sex,String email,String phone){  //for registering
    	this(0,username,password,realname,sex,email,phone,false);
    }
    
    public int getid(){
    	return this.ID;
    }
    public String getusername(){//ȡ���˺�
    	return this.username;
    }
    public String getpassword(){
    	return this.password;
    }
    public void setpassword(String password){
    	this.password=password;
    }
    public String getemail(){
    	return this.email;
    }
    public void setemail(String email){
    	this.email=email;
    }
    public int getsex(){
    	return this.sex;
    }
    public void setsex(int sex){
    	this.sex=sex;
    }
    public void setAdmin(boolean admin){
    	this.isAdmin=admin;
    }
    public boolean isAdmin(){
    	return this.isAdmin;
    }
    public String getrealname(){//ȡ���ǳ�
    	return this.realname;
    }
    public void setrealname(String name){
    	this.realname=name;
    }
    public String getphonenumber(){
    	return this.phoneNumber;
    }
    public void setphonenumber(String number){
    	this.phoneNumber=number;
    }
    public String toString(){
    	return this.realname;
    }
    public boolean getpublic(){
    	return this.ispubliccontact;
    }
    public void setpublic(boolean b){
    	this.ispubliccontact=b;
    }
    
    public User clone(){
    	return new User(this.ID,this.username,this.password,this.realname,this.sex,this.email,this.phoneNumber,this.ispubliccontact);
    }
}
